import java.io.FileWriter;
import java.io.IOException;
import java.io.Writer;

public class Demo6 {
	public static void main(String[] args) {
		//直接使用writer能写入数据
		try(Writer writer=new FileWriter("d:/test.txt",true)) {
			writer.write("我在学习io文件操作");
		} catch (IOException e) {
			throw new RuntimeException(e);
		} ;
	}
}
